import { storeBindingsBehavior} from "mobx-miniprogram-bindings";
import { store} from "../../store";

Component({
    behaviors: [storeBindingsBehavior],
    options: {
        addGlobalClass: true,
    },
    properties: {
        entrance: {
            type: Object,
            value: {},
            default: {
                name_zh: '入口',
                name_uy: 'كىرىش .ېغىزى',
                cover: '',
            }
        },
    },
    onLoad() {
        console.log('Entrance onLoad')
    },
    storeBindings: {
        store,
        fields: {
            lang: () => store.lang
        },
    },
    methods: {
        gotoPath() {
          if (!this.data.entrance.path) {
            wx.showToast({
              title: '未开放，敬请期待',
            })
            return
          }
            wx.navigateTo({
                url: this.data.entrance.path,
            })
        },
    }
});

